Xpages - changing the color of a single cell in a view Panel based on a field value Added by ~Kim Froresatherings on July 18, 2010 | Version 1
|
In Lotus Notes, it is possible to add view columns that "Use value as color". This can be used to change the background color and/or text color of the entire row or just a specific cell. There are already articles on the Wiki that cover setting alternating row colors or changing the color of the entire row. This article focuses on how to change the color of just one cell depending on the value of a document.
|
The demonstration database contains products, which have "units in stock" and a "reorder level". When the standard Products view is displayed in Lotus Notes, a hidden column with "Use value as color" has been placed just before the "Units in Stock" column with the formula: @If(UnitsInStock<=ReorderLevel;255:0:0:-1:-1:-1;-1:-1:-1:-1:-1:-1) This has the effect of changing the background color of the units in stock to red if the value is at or below the reorder level - time to buy some more!! |